package com.winning.vsts.merge;

import com.winning.vsts.merge.service.service.RecordPullRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

/**
 * 请求查询状态信息
 *
 * @author xcl <xcl@winning.com.cn>
 * @date 2021/11/18
 */
@EnableJpaRepositories(basePackages = "com.winning.vsts.merge.service.jpa")
@SpringBootApplication(scanBasePackages = "com.winning.vsts.merge.service")
public class PullRequestQueryApplication implements ApplicationRunner {


    @Autowired
    private RecordPullRequestService recordPullRequestService;


    public static void main(String[] args) {
        new SpringApplicationBuilder()
            .main(PullRequestQueryApplication.class)
            .sources(PullRequestQueryApplication.class)
            .web(WebApplicationType.NONE)
            .build().run(args);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        recordPullRequestService.queryActiveRequestStatus();
    }
}
